﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master" Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.AreaGroup>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	地区-省份
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

      <div id="fullBox">
        <div class="tabListBoxHead">
            <div style="float: left; padding-top: 3px;">
                <img src="/Content/add.png" width="16" height="16" border="0" align="absmiddle" style="margin-right: 3px;" />   
                 <%=Html.ActionLink("地区管理","Index") %>->
                <%=Html.ActionLink((ViewData["PModel"] as AreaGroup).Name, "Pindex", new { areaid = Request.Params["areaid"] })%> 
            </div>
            <div style="float: right;">
            </div>
        </div>
        <div class="tabListBox">
            <table id="ETList" cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                        <th>
                            省份
                        </th>                        
                        <th>
                            城市
                        </th>                         
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
              
                    <% foreach (var item in ViewData["list"] as IEnumerable<AreaGroup>)
                       { %>
                     <tr <%if(!item.IsRoot)Response.Write("class='"+item.TableRowClass+"'"); %> id='<%=item.TableRowId %>'>
                        <td>
                                <%=Html.ActionLink(item.Name,"Cindex",new{areaid=item.Id}) %>
                          
                        </td>                       
                        <td>
                             <%: item.ChildNodes.Count() %>
                        </td>
                         
                        <td>
                            <%=Html.ActionImageLink("/Content/edit.png", "Pindex", new { id = item.Id, areaid = Request.Params["areaid"], an = "pindex" }, new { @title = "编辑" })%>
                            <%=Html.ActionImageLink("/Content/remove.png", "Delete", new { id = item.Id, areaid=Request.Params["areaid"],an = "pindex" }, new { @title = "删除", onclick = "return confirm('删除会把所有子记录删除，你确认吗？');" })%>
                        </td>
                    </tr>
                    <% } %>  <tr>
                <td colspan="3">
                 <% if (ViewContext.RouteData.Values["id"] != null)
       { %>
    <%=Html.Partial("E", Model)%>
    <%}
       else
       { %>
    <%=Html.Partial("C", Model)%>
    <%} %>
                </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<script type="text/javascript">
    $(document).ready(function () {
        var windowWidth = $("#fullBox").width();
        var windowHeight = $("#fullBox").height() - 30;
        $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        $(window).resize(function () {
            var windowWidth = $("#fullBox").width();
            var windowHeight = $("#fullBox").height() - 30;
            $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        });
        $('.tabListBox').fixedHeaderTable({ footer: false, cloneHeaderToFooter: false, autoResize: true, fixCol1: true });

        $('.tabListBox').find("tbody").find("tr").each(function (i) {
            if (i % 2 == 1) {
                $(this).find("td").addClass("tr1");
            }
        });
        $('.tabListBox').find("tbody").find("tr").mouseover(function (i) {
            $(this).find("td").addClass("tr0");
        });
        $('.tabListBox').find("tbody").find("tr").mouseout(function (i) {
            $(this).find("td").removeClass("tr0");
        });

    });
    </script>
    
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>

